import re


try:
    fname = input('Enter file(default mbox.txt): ')
    if fname == '':
        fname = 'mbox.txt'
    fhand = open(fname, 'r')
except Exception as e:
    print(f'Can\'t open the file ({fname})')
    exit()

rets = []
for line in fhand:
    ret = re.findall('New Revision: ([0-9]+)', line)
    if len(ret) > 0:
        rets.append(ret)

total = 0
for ret in rets:
    total += int(ret[0])

print(int(total / len(rets)))
